package components.iteminfo
{
	import capricornus.components.ComponentsManager;
	import capricornus.core.StageManager;
	
	import components.map.item.SceneItem;
	import components.map.item.attribute.SceneItemAttribute;
	import components.map.utils.SceneItemType;

	public class ItemInfoBarManager
	{
		public static const instance:ItemInfoBarManager = new ItemInfoBarManager();
		
		private var _currentItem:SceneItem;
		
		private var _npc:NPCInfoBar;
		
		private var _currentBar:InfoBar;
		
		public function ItemInfoBarManager()
		{
			init();
		}
		
		private function init():void
		{
			_npc = new NPCInfoBar( ComponentsManager.instance.popupLayer );
		}
		
		public function showInfoBarByItem( item:SceneItem ):void
		{
			_currentItem = item;
			var type:int = _currentItem.attribute.type;
			if( type==SceneItemType.NPC )
			{
				_currentBar = _npc;
			}
			_currentBar.setRelateTarget( item );
			_currentBar.show();
		}
	}
}